package com.zhiwei.codesecurity.common.webservice.checkmarx.wsdk.common;

import com.zhiwei.codesecurity.common.base.IEnum;

public enum ReportType implements IEnum {
    PDF(1, "PDF"),
    RTF(2, "RTF"),
    CSV(3, "CSV"),
    XML(4, "XML"),;

    private Integer key;
    private String value;

    private ReportType(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public Integer getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    public static ReportType getInstance(Integer key) {
        ReportType returnType = null;
        ReportType[] reportTypes = values();
        for (ReportType reportType : reportTypes) {
            if (reportType.getKey() == key) {
                returnType = reportType;
                break;
            }
        }
        return returnType;
    }
}
